<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main-template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />



<!-- InstanceBeginEditable name="doctitle" -->
<title>Products | Quang Du Co</title>

<!-- InstanceEndEditable -->

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/product.css"/>
<script type="text/javascript" src="js/products.js"></script>

<!-- InstanceBeginEditable name="CSS" -->CSS<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="JS" -->JS<!-- InstanceEndEditable -->



<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>

<div class="container">
    <div class="left-nav"><a href="index.php" style="border:0px;"><img src="img/logo_QDC.png" style="padding-bottom:30px;" width="170" height="170"/></a>
        <hr />
        <ul style="font-family:myFont-BaiSau; font-size:20px;">
            <li><a href="index.php">Trang chủ</a></li>
            <li><a href="intro.php">Giới thiệu</a></li>
            <li><a href="products.php">Sản phẩm</a></li>
            <li><a href="contact.php">Liên hệ</a></li>
        </ul>
    </div>
    <div class="content">
        <div class="name">
            <span class="company-name">
            <!-- InstanceBeginEditable name="ProductName" -->Sản phẩm<!-- InstanceEndEditable -->
            </span><br/>
            <span class="companu-slogan">
			<!-- InstanceBeginEditable name="ProductInfo" -->Các sản phẩm của QuangDu<!-- InstanceEndEditable -->     
            </span> </div>
        <hr id="clear"/>
        <div class="blank"></div>
        <div id="products">
		<!-- InstanceBeginEditable name="Main content" -->
        <?php
		include_once("admin/lib/ClassSanPham.php");
		$dssanpham = SanPham::LayDanhSachSanPham_ChuaXoa();
		if($dssanpham)
		{
			foreach($dssanpham as $sp)
			{
				//Lấy hình đầu tiên trong danh sách hình theo mã sp làm hình đại diện cho sp
				$urlhinh = SanPham::LayUrlHinhDaiDienChoSanPham($sp->MaSanPham);
				//xử lý lại url
				//url truy xuất từ thư mục admin nên có dạng (../img/xx/xxxxx)
				//phải cắt bỏ phần đầu (../) để trở thành dạng (img/xx/xxxxx)
				$urlhinh = substr($urlhinh,3);
				
				
				echo'
					<div class="product-info" style="background-image:url(img/frame.png)">
						<div class="picture">
							<a href="details.php?id='.$sp->MaSanPham.'"><img src="'.$urlhinh.'" width="179" height="142" /></a>
						</div>
						<p class="infomation">
							'.$sp->TenSanPham.'
						</p>
		            </div>
				';
			}
		}
		else
		{
			echo 'Không có sản phẩm nào.';
		}
		
        ?>
            
		<!-- InstanceEndEditable -->
        </div>
        <div class="blank"></div>
        <hr id="clear" />
        <p id="company-info"> <span style="font-family:myFont-VNI-Avo;text-transform:uppercase;color:#444;font-style:normal;font-weight:bold;line-height:30px;">Quang Du CO</span><br/>
        <span style="font-family:myFont-BaiSau;font-size:15px;color:#555;">
            <span><!-- InstanceBeginEditable name="Phone" -->
            <?php
				include_once("admin/lib/ClassQuanLy.php");
				$ql = QuanLy::LayTatCaThongTin();
        	?>
            Di động : <?php echo $ql->Mobile; ?><!-- InstanceEndEditable --></span><br/>
            <span><!-- InstanceBeginEditable name="Address" -->Địa chỉ : <?php echo $ql->DiaChiCongTy; ?> 
			<!-- InstanceEndEditable --></span><br/>
        </span>
        </p>
        <div class="blank"></div>
    </div>
    <div class="blank" id="black-blank" ></div>
</div>
</body>
<!-- InstanceEnd --></html>
